﻿CREATE PROCEDURE [dbo].[sp_Update_LastExecuteTime]
	@Command varchar(10), 
	@LastExecuteTime datetime
AS
	IF EXISTS (SELECT * FROM dbo.CommandHistory WHERE Command = @Command)
		UPDATE dbo.CommandHistory SET LastExecuteTime = @LastExecuteTime WHERE Command = @Command
	ELSE
		INSERT INTO dbo.CommandHistory SELECT Command = @Command, LastExecuteTime = @LastExecuteTime
		